//
//  Utility.m
//  W2MD
//
//  Created by zhudongwei on 14/12/19.
//  Copyright (c) 2014年 zhudongwei. All rights reserved.
//

#import "Utility.h"
#import "HelpView.h"

@implementation Utility
+(void)showHelpWith:(NSString*)imgName
{
    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
    if (![userDefaults valueForKey:imgName]) {
        [userDefaults setObject:@"YES" forKey:imgName];
        NSArray *windows = [[UIApplication sharedApplication] windows];
        if ([windows count]) {
            UIWindow *mainwindow = windows[0];
            NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"HelpView" owner:self options:nil];
            HelpView * helpview = [nib objectAtIndex:0];
            [helpview showImg:imgName];
            helpview.alpha=0;
            [mainwindow addSubview:helpview];
            [UIView animateWithDuration:0.3 animations:^{
                helpview.alpha=1;
            }];
        }
    }
    

}
@end
